<template>
    <div>
      <el-table :data="classes" style="width: 100%">
        <el-table-column prop="ClassID" label="班级ID" width="180"></el-table-column>
        <el-table-column prop="ClassName" label="班级名称"></el-table-column>
        <el-table-column prop="MajorID" label="专业ID"></el-table-column>
      </el-table>
    </div>
  </template>
  
  <script>
  import axios from 'axios';
  
  export default {
    data() {
      return {
        classes: []
      };
    },
    mounted() {
      this.fetchClasses();
    },
    methods: {
      async fetchClasses() {
        const response = await axios.get('/api/classes');
        this.classes = response.data;
      }
    }
  };
  </script>
  
  <style>
  </style>
  